package cn.edu.scau.cmi.liquan.Comprehensive;

import java.net.URL;
import java.util.ResourceBundle;

//import com.sun.xml.internal.ws.transport.http.DeploymentDescriptorParser.AdapterFactory;

import cn.edu.scau.cmi.liquan.client.AbstractFactoryClient;
import cn.edu.scau.cmi.liquan.client.AdapterClient;
import cn.edu.scau.cmi.liquan.client.CompositeSafetyClient;
import cn.edu.scau.cmi.liquan.client.CompositeSameClient;
import cn.edu.scau.cmi.liquan.client.ComprehensionHibernateClient;
import cn.edu.scau.cmi.liquan.client.FactoryClient;
import cn.edu.scau.cmi.liquan.client.IOCSpringClient;
import cn.edu.scau.cmi.liquan.client.InterProgrammingClient;
import cn.edu.scau.cmi.liquan.client.MultipletonClient;
import cn.edu.scau.cmi.liquan.client.SimpleFactoryMethodClient;
import cn.edu.scau.cmi.liquan.client.SingletonClient;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.stage.Stage;


public class Controller  implements Initializable{
	@FXML
	private Button b_singleton;
	@FXML
	private Button b_multition;
	@FXML
	private Button b_interface;
	@FXML
	private Button b_simpleFactory;
	@FXML
	private Button b_factory;
	@FXML
	private Button b_abstractFactory;
	@FXML
	private Button b_adapterObject;
	@FXML
	private Button b_adapterClass;
	@FXML
	private Button b_satefyComposite;
	@FXML
	private Button b_sameComposite;
	@FXML
	private Button b_hibernate;
	@FXML
	private Button b_spring;
	
	
	public void initialize(URL location, ResourceBundle resources) {
	}
	
	public void Csingleton(ActionEvent event) throws Exception {
		System.out.println("单例模式");
		 SingletonClient w=new  SingletonClient();
		 w.start(new Stage());
		
	}
	
    public void Cmultition(ActionEvent event) throws Exception {
    	System.out.println("多例模式");
    	 MultipletonClient w=new  MultipletonClient();
		 w.start(new Stage());
		 
	}
    
    public void Cinterface(ActionEvent event) {
    	System.out.println("接口编程");
    	InterProgrammingClient a=new InterProgrammingClient();
    	a.main(null);
	}
   
    public void CsimpleFactory(ActionEvent event) {
    	System.out.println("简单工厂");
    	SimpleFactoryMethodClient a=new SimpleFactoryMethodClient();
    	a.main(null);
	}
    
     public void Cfactory(ActionEvent event) {
    	 System.out.println("工厂模式");
    	 FactoryClient a=new FactoryClient();
    	 a.main(null);
	}
     
     public void CabstractFactory(ActionEvent event) throws Exception {
    	 System.out.println("抽象工厂");
    	 AbstractFactoryClient w=new  AbstractFactoryClient();
    	 w.main(null);
 	}
     
     public void CadapterObject(ActionEvent event) throws Exception {
    	 System.out.println("两类适配器");
    	 AdapterClient w=new  AdapterClient();
		 w.start(new Stage());
 	}
     
   
     
     public void CsatefyComposite(ActionEvent event) {
    	 System.out.println("安全组合");
    	 CompositeSafetyClient a=new CompositeSafetyClient();
    	 a.main(null);
  	}
     
     public void CsameComposite(ActionEvent event) {
    	 System.out.println("一致组合");
    	 CompositeSameClient a=new CompositeSameClient();
    	 a.main(null);
   	}
     
     public void Chibernate(ActionEvent event) {
    	 System.out.println("hibernate模式");
    	 ComprehensionHibernateClient a=new ComprehensionHibernateClient();
    	 a.main(null);
   	}
      
      public void Cspring(ActionEvent event) {
    	  System.out.println("spring模式");
    	 IOCSpringClient a=new  IOCSpringClient();
    	  a.main(null);
    	}

}
